Learn R Programming

ghyp (version 0.9.3)

ghyp object data: Get methods for objects inheriting from class ghypbase

Description

These functions simply return values stored within generalized hyperbolic distribution objects. ghyp.fit.info extract information about the fitting procedure from objects of class mle.ghypuv and mle.ghypmv.

Usage

ghyp.params(object, type = c("chipsi", "alpha.bar"))

ghyp.fit.info(object)

ghyp.data(object)

Arguments

object
An object inheriting from class ghypbase.
type
The parameters of either the (lambda, alpha.bar, mu, sigma, gamma) or the (lambda, chi, psi, mu, sigma, gamma) parametrization will be returned.

Value

  • ghyp.params reutrns the parameters of the generalized hyperbolic distribution as a list with components: rl{ lambda Shape parameter. alpha.bar Shape parameter. chi/psi Shape parameters. mu Location parameter. sigma Dispersion parameter. gamma Skewness parameter. } ghyp.fit.info returns list with components: rl{ logLikelihood The maximized log-likelihood value. aic The Akaike information criterion. fitted.params A boolean vector stating which parameters were fitted. converged A boolean whether optim converged or not. n.iter The number of iterations. error.code Error code from optim. error.message Error message from optim. parameter.variance Parameter variance (only for univariate fits). }

    ghyp.data returns NULL if no data is stored within the object, a vector if the object is of class mle.ghypuv or a matrix if the object is of class mle.ghypmv.

See Also

mean, vcov, logLik, AIC, fit.ghypmv, fit.ghypuv, ghyp, optim

Examples

Run this code
## multivariate generalized hyperbolic distribution
  ghyp.mv <- ghyp(lambda=1, alpha.bar=0.1, mu=rep(0,2), sigma=diag(rep(1,2)), 
                  gamma=rep(0,2),data=matrix(rt(1000,df=4),ncol=2))
  ## Get parameters
  ghyp.params(ghyp.mv,type="alpha.bar")
  ghyp.params(ghyp.mv,type="chipsi")  

  ## Get data
  ghyp.data(ghyp.mv)

  ## 'ghyp.fit.info' does only work when the object is of class 'mle.ghypuv' 
  ## or 'mle.ghypmv', i.e. is created using 'fit.ghypuv' etc.
  mv.fit <- fit.tmv(data = ghyp.data(ghyp.mv), control=list(abs.tol=1e-3))
  ghyp.fit.info(mv.fit)

Run the code above in your browser using DataLab